from rest_framework import status
from rest_framework.exceptions import APIException
from django.utils.translation import gettext_lazy as _


class PasswordError(APIException):
    status_code = status.HTTP_404_NOT_FOUND
    default_detail = _('原密码错误。')
    default_code = 'not_found'


class AccountHasBeenExistError(APIException):
    status_code = status.HTTP_202_ACCEPTED
    default_detail = _('该账号已存在。')
    default_code = 'invalid'


class EmailHasBeenExistError(APIException):
    status_code = status.HTTP_202_ACCEPTED
    default_detail = _('该邮箱已存在。')
    default_code = 'invalid'


class NicknameChangeError(APIException):
    status_code = status.HTTP_404_NOT_FOUND
    default_detail = _('昵称已存在')
    default_code = 'invalid'

class UserExistError(APIException):
    status_code = status.HTTP_202_ACCEPTED
    default_detail = _('该邮箱已存在。')
    default_code = 'invalid'